package com.usian.pay.controller;

import com.usian.pay.config.MessageQueueHelper;
import com.usian.pay.vo.Mail;
import com.usian.pay.vo.Sms;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @TODO:
 * @Author:baimu
 * @Date:2024 07 19 13 59
 **/

@RestController
@RequestMapping("/api/test/mq" )
public class TestController {


    @Autowired
    MessageQueueHelper  messageQueueHelper;

    @RequestMapping("send")
    public void sendMsage() {
        Mail mail = new Mail("1","我是邮件");
        messageQueueHelper.sendMessage("message_ex", "mail.send", "mail", mail);
        Sms sms = new Sms("1","我是短信");
        messageQueueHelper.sendMessage("message_ex", "sms.send", "sms", sms);
    }


}
